Internet Subscriptions
Internet Subscriptions#
ict_stats <- read.csv("ict_stats.csv")
str(ict_stats)
'data.frame': 44 obs. of 4 variables:
$ Year : int 2011 2011 2011 2011 2012 2012 2012 2012 2013 2013 ...
$ Quarter: chr "Q1" "Q2" "Q3" "Q4" ...
$ ADSL : int 14082 14419 14474 15707 16298 17204 18166 18838 19388 23224 ...
$ Mobile : int 189803 200198 224474 238942 263131 294548 509926 769805 958074 1098523 ...
summary(ict_stats)
Year Quarter ADSL Mobile
Min. :2011 Length:44 Min. : 14082 Min. : 189803
1st Qu.:2013 Class :character 1st Qu.: 24406 1st Qu.:1231656
Median :2016 Mode :character Median : 38898 Median :1426741
Mean :2016 Mean : 43136 Mean :1442396
3rd Qu.:2019 3rd Qu.: 55572 3rd Qu.:1915367
Max. :2021 Max. :101915 Max. :2496146
ict_stats$Quarter <- as.factor(ict_stats$Quarter)
head(ict_stats)
| Year | Quarter | ADSL | Mobile | |
|---|---|---|---|---|
| <int> | <fct> | <int> | <int> | |
| 1 | 2011 | Q1 | 14082 | 189803 |
| 2 | 2011 | Q2 | 14419 | 200198 |
| 3 | 2011 | Q3 | 14474 | 224474 |
| 4 | 2011 | Q4 | 15707 | 238942 |
| 5 | 2012 | Q1 | 16298 | 263131 |
| 6 | 2012 | Q2 | 17204 | 294548 |
library(dplyr)
library(viridis)
library(ggplot2)
library(plotly)
library(gridExtra)
par(mfrow=c(2,1))
g1 <- ggplot(ict_stats, aes(x = Year, y = ADSL, color = Quarter)) +
geom_line() +
scale_y_continuous(labels = scales::unit_format(scale = 1e-6)) +
ggtitle('ADSL Subscriptions') +
theme(plot.title = element_text(hjust = 0.5)) +
scale_color_viridis(discrete = TRUE)
g2 <- ggplot(ict_stats, aes(x = Year, y = Mobile, color = Quarter)) +
geom_line() +
scale_y_continuous(labels = scales::unit_format(scale = 1e-6)) +
ggtitle('Mobile Phone Internet Subscriptions') +
theme(plot.title = element_text(hjust = 0.5)) +
scale_color_viridis(discrete = TRUE)
ggplotly(g1)
ggplotly(g2)